/**
 * 替换模板中的占位符
 * @param {string} template 模板字符串
 * @param {Object} data 占位符数据枚举
 * @param {Object} options 选项
 * @returns {string} 替换后的字符串
 */
export const replacePlaceholder = (template, data) => {
  return template.replace(/\{(\w+)\}/g, (match, key) => {
    const value = data[key]
    if (!value) throw new Error(`Missing placeholder value for ${key}`)
    return value
  })
}
